package TAIC.Classifier;

public class ClassifierFactory {
	public Classifier getClassifer ( String name ) {
		try {
			return (Classifier) Class.forName( name ).newInstance() ;
		}
		catch ( Exception e ) {
			e.printStackTrace() ; 
			System.out.println ( "No class " + name + " exists") ;
			System.exit( 0 ) ; 
			return null ;
		}
	}
	
	
	public Divergence getDivergence ( String name ) {
		try {
			return (Divergence) Class.forName( name ).newInstance() ;
		}
		catch ( Exception e ) {
			e.printStackTrace() ; 
			System.out.println ( "No class " + name + " exists") ;
			System.exit( 0 ) ; 
			return null ;
		}
	}
}
